using System;
using System.Collections;
using System.Collections.Specialized;
using System.IO;
using System.Runtime.InteropServices;
namespace BMC.ARSystem
{
	[ARStructTypeInfo(Name = "ARImageStruct", NumberOfMembers = 13u), ClassInterface, Guid("3DF1EEE5-8B83-4d32-AF3A-9CC27BA439DE"), ProgId("BMC.ARSystem.Image")]
	public class Image
	{
		[Guid("590DF21E-4EDD-4f41-AA28-89FB3FEE5E3C")]
		public enum MemberFlags
		{
			Name = 1,
			NewName,
			Content = 4,
			Type = 8,
			Description = 16,
			Checksum = 32,
			HelpText = 64,
			Owner = 128,
			ChangeDiary = 256,
			Properties = 512,
			LastUpdateTime = 1024,
			LastModifiedBy = 2048,
			ModificationLogLabel = 4096,
			TaskName = 8192
		}
		[ARStructMemTypeInfo(Name = "name", Offset = 0u)]
		private string _name;
		[ARStructMemTypeInfo(Name = "content", Offset = 1u)]
		private byte[] _content;
		[ARStructMemTypeInfo(Name = "type", Offset = 2u)]
		private string _type;
		[ARStructMemTypeInfo(Name = "timestamp", Offset = 3u)]
		private DateTime _timestamp;
		[ARStructMemTypeInfo(Name = "checksum", Offset = 4u)]
		private string _checksum;
		[ARStructMemTypeInfo(Name = "description", Offset = 5u)]
		private string _description;
		[ARStructMemTypeInfo(Name = "helpText", Offset = 6u)]
		private string _helpText;
		[ARStructMemTypeInfo(Name = "owner", Offset = 7u)]
		private string _owner;
		[ARStructMemTypeInfo(Name = "lastChanged", Offset = 8u)]
		private string _lastChanged;
		[ARStructMemTypeInfo(Name = "changeDiary", Offset = 9u)]
		private DiaryList _changeDiary;
		[ARStructMemTypeInfo(Name = "objPropList", Offset = 10u)]
		private IDictionary _objPropList;
		[ARStructMemTypeInfo(Name = "modificationLogLabel", Offset = 11u)]
		private string _modificationLogLabel;
		[ARStructMemTypeInfo(Name = "taskName", Offset = 12u)]
		private string _taskName;
		private BitVector32 _modifyFlags;
		private string _newName;
		public string Name
		{
			get
			{
				return this._name;
			}
			set
			{
				if (this._name == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 1);
				this._name = value;
			}
		}
		public string NewName
		{
			get
			{
				return this._newName;
			}
			set
			{
				if (this._newName == value || this._newName == this._name)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 2);
				this._newName = value;
			}
		}
		public byte[] Content
		{
			get
			{
				return this._content;
			}
			set
			{
				this._content = value;
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 4);
			}
		}
		public string Type
		{
			get
			{
				return this._type;
			}
			set
			{
				if (this._type == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 8);
				this._type = value;
			}
		}
		public string Description
		{
			get
			{
				return this._description;
			}
			set
			{
				if (this._description == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 16);
				this._description = value;
			}
		}
		public string Checksum
		{
			get
			{
				return this._checksum;
			}
			set
			{
				if (this._checksum == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 32);
				this._checksum = value;
			}
		}
		public string HelpText
		{
			get
			{
				return this._helpText;
			}
			set
			{
				if (this._helpText == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 64);
				this._helpText = value;
			}
		}
		public string Owner
		{
			get
			{
				return this._owner;
			}
			set
			{
				if (this._owner == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 128);
				this._owner = value;
			}
		}
		public DiaryList ChangeDiary
		{
			get
			{
				return this._changeDiary;
			}
			set
			{
				if (this._changeDiary == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 256);
				this._changeDiary = value;
			}
		}
		public IDictionary Properties
		{
			get
			{
				return this._objPropList;
			}
			set
			{
				if (this._objPropList == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 512);
				this._objPropList = value;
			}
		}
		public DateTime LastUpdateTime
		{
			get
			{
				return this._timestamp;
			}
		}
		public string LastModifiedBy
		{
			get
			{
				return this._lastChanged;
			}
		}
		public string ModificationLogLabel
		{
			get
			{
				return this._modificationLogLabel;
			}
			set
			{
				if (this._modificationLogLabel == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 4096);
				this._modificationLogLabel = value;
			}
		}
		public string TaskName
		{
			get
			{
				return this._taskName;
			}
			set
			{
				if (this._taskName == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 8192);
				this._taskName = value;
			}
		}
		[ComVisible(false)]
		public BitVector32 MembersModified
		{
			get
			{
				return this._modifyFlags;
			}
			set
			{
				this._modifyFlags = value;
			}
		}
		public int MembersModifiedAsInt
		{
			get
			{
				return this._modifyFlags.get_Data();
			}
			set
			{
				this._modifyFlags = new BitVector32(value);
			}
		}
		public Image()
		{
			this._modifyFlags = new BitVector32(1);
		}
		public Image(string name) : this()
		{
			this.Name = name;
		}
		internal Image(object[] rawData, Server server)
		{
			server.Session.CurrentObjectType = Server.ObjectType.Image;
			this.Name = (string)Util.GetAt(rawData, new int[]
			{
				3
			});
			this.Content = (byte[])Util.GetAt(rawData, new int[]
			{
				4,
				1
			});
			this.Type = (string)Util.GetAt(rawData, new int[]
			{
				5
			});
			this._timestamp = Util.GetDateTime(Convert.ToUInt32(Util.GetAt(rawData, new int[]
			{
				6
			})));
			this.Checksum = (string)Util.GetAt(rawData, new int[]
			{
				7
			});
			this.Description = (string)Util.GetAt(rawData, new int[]
			{
				8
			});
			this.HelpText = (string)Util.GetAt(rawData, new int[]
			{
				9
			});
			this.Owner = (string)Util.GetAt(rawData, new int[]
			{
				10
			});
			this._lastChanged = (string)Util.GetAt(rawData, new int[]
			{
				11
			});
			this.ChangeDiary = DiaryList.Decode((string)Util.GetAt(rawData, new int[]
			{
				12
			}));
			ARTypeMgr arg_18E_0 = ARTypeMgr.Instance;
			Type arg_18E_1 = typeof(HybridDictionary);
			string arg_18E_2 = "System.Int32";
			int[] keyIndex = new int[1];
			this.Properties = arg_18E_0.BuildCustomDictionaryFromVariant(arg_18E_1, arg_18E_2, keyIndex, "ARValue", new int[]
			{
				1
			}, (object[])Util.GetAt(rawData, new int[]
			{
				13
			}), server);
			this._modifyFlags = new BitVector32(1);
		}
		internal static Image createInstance(object[] rawData, Server server)
		{
			return new Image(rawData, server);
		}
		public void LoadFromFile(string path)
		{
			FileStream fileStream = File.OpenRead(path);
			byte[] array = new byte[fileStream.get_Length()];
			fileStream.Read(array, 0, array.Length);
			if (array.Length > 0)
			{
				this.Content = array;
			}
			fileStream.Close();
		}
	}
}
